var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "checkDate",
			name : "检查日期"
		}, {
			colkey : "shelfNo",
			name : "模架号"
		}, {
			colkey : "mold_encode",
			name : "模具编号"
		}, {
			colkey : "sortName",
			name : "类别"
		}, {
			colkey : "pSchedule",
			name : "备模班组",
			renderData : function(rowindex,data, rowdata, column) {
				if (data==1 || data=="1"){
					return "甲班";
				}else if (data==2 || data=="2"){
					return "乙班";
				}else{
					return "";
				}
			}
		}, {
			colkey : "pStaff1",
			name : "备模人员1"
		}, {
			colkey : "pStaff2",
			name : "备模人员2"
		}, {
			colkey : "pStaff3",
			name : "备模人员3"
		}, {
			colkey : "pBeginTime",
			name : "开始备模时间"
		}, {
			colkey : "pEndTime",
			name : "结束备模时间"
		}],
		jsonUrl : rootPath + '/pAfterCheck/pAfterCheck_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑备模后模具质量检查表",
		type : 2,
		area : [ "1200px", "100%" ],
		content : rootPath + '/pAfterCheck/pAfterCheck_edit.shtml?id=' + cbox
	});
}
